<%@ page import="minusjudge.User" %>



<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'userName', 'error')} required">
	<label for="userName">
		<g:message code="user.userName.label" default="User Name" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="userName" required="" value="${userInstance?.userName}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'password', 'error')} required">
	<label for="password">
		<g:message code="user.password.label" default="Password" />
		<span class="required-indicator">*</span>
	</label>
	<g:field type="password" name="password" required="" value="${userInstance?.password}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'email', 'error')} required">
	<label for="email">
		<g:message code="user.email.label" default="Email" />
		<span class="required-indicator">*</span>
	</label>
	<g:field type="email" name="email" required="" value="${userInstance?.email}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'role', 'error')} ">
	<label for="role">
		<g:message code="user.role.label" default="Role" />
		
	</label>
	<g:select name="role" from="${userInstance.constraints.role.inList}" value="${userInstance?.role}" valueMessagePrefix="user.role" noSelection="['': '']"/>
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'institution', 'error')} ">
	<label for="institution">
		<g:message code="user.institution.label" default="Institution" />
		
	</label>
	<g:textField name="institution" value="${userInstance?.institution}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: userInstance, field: 'clarifications', 'error')} ">
	<label for="clarifications">
		<g:message code="user.clarifications.label" default="Clarifications" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${userInstance?.clarifications?}" var="c">
    <li><g:link controller="clarification" action="show" id="${c.id}">${c?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="clarification" action="create" params="['user.id': userInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'clarification.label', default: 'Clarification')])}</g:link>
</li>
</ul>

</div>

